/*
	Object and membership values.
*/

import java.util.Vector;

class FuzzyObject{

    protected String id;
    protected Vector<MembershipOC> m_values;
    
    public FuzzyObject(String id){
	    this.id = id;
	    this.m_values = new Vector();
    }
    
    public String getId(){return this.id;}
    public Vector<MembershipOC> getMembershipValues(){return this.m_values;}


    public MembershipOC getMembershipByClass(String mclass){
	for(int i=0;i< this.m_values.size();i++){
	    MembershipOC m = this.m_values.elementAt(i);
	    if((m.getNameClass()).equals(mclass))
		return m;
	}//for
	return null;
    }

    public void addMembership(MembershipOC m){this.m_values.add(m);}
    
    public String toString(){
	String s=this.id+"\n";
	for(int i=0;i<this.m_values.size();i++){
	    MembershipOC m = m_values.elementAt(i);
	    s+=m.getNameClass()+ ":"+ m.getMembershipValue()/m.getTimes()+"\n";
	}
	return s;
    }
}//end FuzzyObject
